# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnice
pkgver=0.1.17
pkgrel=0
pkgdesc="GLib ICE implementation"
options="!check" # Testsuite fails
url="https://nice.freedesktop.org/wiki/"
arch="all"
license="LGPL-2.1-or-later AND MPL-1.1"
makedepends="
	glib-dev
	gnutls-dev
	gstreamer-dev
	gobject-introspection-dev
	gtk-doc
	meson"
subpackages="
	$pkgname-dbg
	$pkgname-dev
	$pkgname-doc
	$pkgname-gstreamer:_gst"
source="https://nice.freedesktop.org/releases/libnice-$pkgver.tar.gz"

build() {
	meson \
		--prefix=/usr \
		--libdir=/usr/lib \
		--bindir=/usr/bin \
		--buildtype=plain \
		-Dgtk_doc=enabled \
		-Dtests=disabled \
		-Dexamples=disabled \
		-Dintrospection=enabled \
		-Dcrypto-library=gnutls \
		-Dgstreamer=enabled \
		-Dgupnp=disabled builddir
	ninja -C builddir
}

package() {
	DESTDIR="$pkgdir" ninja -C builddir install
}

_gst() {
	pkgdesc="Gstreamer 1.0 plugin for libnice"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/gstreamer-1.0 "$subpkgdir"/usr/lib/
}

sha512sums="177ee47712233af379f422cbe24befaa1b744444241723a6575f17db30f7032aa8a34b1c6e160f6f406545fc42c1e7e3ca36c274bea5adb169b02434712c908e  libnice-0.1.17.tar.gz"
